home *** CD-ROM | disk | FTP | other *** search
- Path: news.erg.cuhk.hk!ywleung
- From: ywleung@cs.cuhk.hk (Marty McFly)
- Newsgroups: comp.lang.c++
- Subject: How to delete array of pointers?
- Date: 10 Feb 1996 02:28:46 GMT
- Organization: Engineering Faculty CUHK
- Message-ID: <4fgvsu$5q4@eng_ser1.erg.cuhk.hk>
- NNTP-Posting-Host: sun12.cs.cuhk.hk
- X-Newsreader: TIN [version 1.2 PL2]
-
- If I write the following code in a function:
-
- int** ptr;
- ptr = new int*[1000];
-
- Is this code means allocating 1000 integer pointers which is pointed by ptr?
- And then somehow I assign integer variable to ptr[0], ptr[1], ... and so on.
- So at the end of the function, how can I reclaim just those pointers? The key
- point is that those integer variable assigned to the pointers should not be
- deleted.
-
- Regards,
- Marty McFly.
-